Copyright: Copyright ® 1994 by Digital PowerTOOLS


contents
WavPlus.DLL Help

Copyright © 1994 by Digital PowerTOOLS

Another Shareware Product from Digital PowerTOOLS

Overview of WavPlus.DLL

Assorted Functions

MIDI Info Functions (non-MCI)

MIDI Open Session Functions (MCI)

Wav Functions (non-MCI)

Wav File Info Functions (MCI)

Wav System Info Functions (MCI)

Wav Open Session Functions (MCI)

Copyright Notice

Order Form and Software Evaluation Form

Shareware Concept

Shareware License

Shareware Registration

Custom DLL's

Registered License


Overview
Overview of WavPlus.DLL

MicroSoft's VisualBasic is a powerful programming language for the Windows operating system.  One of its most appealing features is it extensibility. You can add subroutines and functions directly within the language.  You can use most of the 800+ Windows API functions.  And, you can use virtually any Dynamic Link Library (DLL) or VBX (a specialized type of DLL).  The author, with 12 years of programming experience, prefers VB to Assembly, C, and C++.

The VB Pro version comes with the Multimedia MCI Control that allows you to play and record WAV and MIDI files.  Until now, users of the VB standard version have not had this capability without resorting to the complex functionality of the Windows 3.1 MCI (Media Control Interface) API.  WavPlus.DLL simplifies programming Wav (and Mid) playback and recording by providing an easy-to-understand command structure.  You can even playback sections of Wav files which conserves valuable disk space by combining several waveforms into a single file.  WavPlus.DLL utilizes both MCI and low-level access.

The demo program (written in VB 3.0 standard) demonstrates nearly all of the new Wav features of WavPlus and reveals a few VB programming tricks too.  And, since WavPlus.DLL comes with a complete Help file and a practical demonstration project in VB, you'll quickly understand how to use the new functions so that you can incorporate these SoundCard techniques into your own projects.


Shareware Concept

Commercial software is copyrighted (protected by law) and is typically sold through computer and department stores and through discount mail order houses.  The quality of most commercial software is usually very good to excellent.  Public domain software is not copyrighted and is typically found on computer bulletin boards.  The quality of public domain software ranges from poor to very good.  Shareware has similarities with both commercial and public domain software.  The quality is usually good to excellent (frequently surpassing commercial software in price versus features); and shareware can be obtained from computer bulletin boards, on disks in the back of some computer books, computer stores, on racks in some book stores, and from mail order houses.

Shareware is COPYRIGHTED (protected by law).  However, the author typically authorizes distribution of the software to others in the hopes that the users will like the program enough to send in a registration fee which removes a 'Need To Register' message (when the registration number is sent by return mail or an upgrade is provided) and offers notification of program updates and other benefits.  And ... sending the registration fee encourages the author to write MORE software.

Many shareware authors are professional programmers who write these programs in their spare time.  The fundamental concept of shareware is TRY, BEFORE YOU BUY.  And, not only do you get to try the program before you buy; but, you also will typically get professional quality software at well below the market price of comparable commercial packages when you do register.

The FUTURE of shareware depends on YOU.  If you continue using a shareware package, you should register it.

You have 30 days to evaluate WavPlus.DLL once you install it on your system.  After that, you should either register it or remove it from your system.


Custom DLL's

Digital PowerTOOLS is dedicated to helping VB and C programmers.  Moreover, we will consider custom DLL and/or VBX projects which have potential mass market appeal.  And, of course, we certainly consider enhancements to our released products.  Write to:

Digital PowerTOOLS
P.O. Box 97794
Jackson, MS  39288-7794


Copyright Notice

WavPlus.DLL, Copyright © 1994 by Digital PowerTOOLS

WavPlus.DLL is distributed under the shareware concept.  Shareware Registration is mandatory for continued use of this product.

And, as shareware, you may evaluate WavPlus.DLL for a period of no more than 30 days.  After this time you must either register it or remove it from your system. Failure to comply with this condition is a violation of United States and international copyright law.

This program is fully functional, however you will receive the latest version upon registering (with the startup registration reminder removed).  Please register if you use this program for more than the 30-day trial period.  See Shareware Registration for more specific details on registering this product.


Shareware License

Shareware Distribution

You have the right to freely distribute the unregistered version of this software which includes uploading to BBS's provided that:  (1) no files in the original package are altered in any way and that the the software is not sold for profit -- cost of duplication and shipping may, of course, be requested in distribution to end users, (2) all the files must be distributed together, and (3) individual copies of this software may not be sold for more than $10.00.

You must stop selling/distributing copies of this version of this software upon written notice from the author or Digital PowerTOOLS.  The terms of this distribution license are subject to change with the release of new versions of this software.  This software may not be represented as anything other than shareware and the shareware concept must be explained in any advertisement or catalog that quotes a price and on any packaging used to display the disk.  The explanation of the shareware concept must make it clear that with shareware an additional registration fee is required if users continue to utilize the software.

Shareware Registration

You have the right to use this unregistered software for a period not to exceed 30 days from installation.  After this trial period, you should either register it or remove it from your system.  Failure to comply with this software license is a violation of U.S. Copyright laws.  See Software Registration for more details.

Site Licenses

Write to receive the latest details on site licenses.

Rack Sales & CD Distribution

Write to request the latest details on rack sales and other For-Profit distribution.  You may not include this shareware on a CD-ROM or other type of package produced by any user group, commercial library, or any for-profit or nonprofit organization; and you may not distribute same with any other product or as an incentive to purchase any other product without the express written permission of Digital PowerTOOLS.  This software may not be sold on retail racks or CD-ROM disks, by either ASP or non-ASP vendors, without specific written permission from the Digital PowerTOOLS.


Shareware Registration

This program is Shareware.  You may evaluate if for a period of no more than 30 days.  After this time you should either register it or remove it from your system. Failure to comply with this condition is a violation of United States and international copyright law.  If you do find that this program is applicable to your computer usage, please send in your registration fee.

Take it for a spin around the block.  Kick the tires.  Look under the hood.  If you like it and use it, register the application.  If it doesn't suit your needs, take it off your system.  If you do enjoy the features that WavPlus.DLL gives you, try other products from Digital PowerTOOLS too.

(notice the subliminal messages)  This program is provided as Shareware and may be freely distributed (according to the terms under the Shareware License).  If you find the program useful (register today), we ask that you send in the nominal registration fee of $10.00 to the address below.  Many hours of work went into this project.  And, this registration fee includes FREE shipping of the latest version on disk.

Registering this product will also encourage us to write more software under the Shareware concept (register today) for the PC.  If you like it, register it (register today).  If you don't, don't -- and remove it from your system.  Either way, though, we'd like hear your suggestions for improvement (register today) -- send in the Software Evaluation form (EvalFrm.Wri).  And ... registered users will have any questions answered (register today).  The future of Shareware depends on YOU ... register today.

Be sure to include the PROGRAM TITLE and VERSION NUMBER that you have.  Also specify the disk format that you prefer (3.5-HD or 5.25-HD) of the latest version.  Be sure to include your name, company, and mailing address.  You may also use our order form (OrderFrm.Wri).

Thank you (yadot retsiger).  You may also contact the author with private mail through America Online, ID# Vernon486.  Mail check, money order, cash and/or suggestions to (Make checks payable to Digital PowerTOOLS):

Digital PowerTOOLS   P.O. Box 97794   Jackson, MS  39288-7794


Order Form

Order Form

This product includes a file in Windows Write format entitled OrderFrm.Wri which you can use to print an order form for registering WavPlus.DLL.

Sofware Evaluation Form

This package includes a file in Windows Write format entitled EvalFrm.Wri which you can use to print a software evaluation form.

Address

Send to:

Digital PowerTOOLS
P.O. Box 97794
Jackson, MS  39288-7794


Registered License

Upon registration of this product, you may include WavPlus.DLL in your own application projects to end users.  You may not offer WavPlus.DLL as an independent application or utility; and, you may not offer WavPlus.DLL in a manner that would directly compete with the product.

WavPlus.DLL is provided as a utility to enhance the functionality of your own applications .  As such, you are not permitted to reveal how to use the functions of WavPlus.DLL to your end users without the express written permission of Digital PowerTOOLS.

It is our sincere hope that as a registered user of this product you find WavPlus.DLL to be a welcome addition to your library of VB (or C) utilities.  If you have questions about usage or suggestions for improvement, please write to let us know.  We appreciate your business!


Functions:  Wav (Non-MCI)
Wav Functions (non-MCI)

Declare Function PlayWavWait% Lib "WavPlus.DLL" (ByVal lpString$)

* this function plays a Wav file waiting for completion before returning control to the
  calling program

* lpString$ is the full path of the Wav file to play
* returns TRUE (-1) is the Wav file can be played; returns FALSE (0) otherwise

Declare Function PlayWavNoWait% Lib "WavPlus.DLL" (ByVal lpString$)

* this function plays a Wav file and returns control to the calling program as soon as the
  Wav file begins

* lpString$ is the full path of the Wav file to play
* returns TRUE (-1) is the Wav file can be played; returns FALSE (0) otherwise

Declare Function PlayWavLoop% Lib "WavPlus.DLL" (ByVal lpString$)

* this function plays a Wav file in a repeat loop; returns control to the calling program as
  soon as the Wav file begins

* lpString$ is the full path of the Wav file to play
* returns TRUE (-1) is the Wav file can be played; returns FALSE (0) otherwise

Declare Function StopWavLoop% Lib "WavPlus.DLL" ()

* this function stops a Wav file loop started with PlayWavLoop

* returns TRUE (-1) is the Wav file can be played; returns FALSE (0) otherwise

Declare Function HowManyWavPlayDevices% Lib "WavPlus.DLL" ()

* this function determines the number of system devices that can PLAY Wav files

* returns the number: 0 for none, 1 for one, etc.

Declare Function HowManyWavRecordDevices% Lib "WavPlus.DLL" ()

* this function determines the number of system devices that can RECORD Wav files

* returns the number: 0 for none, 1 for one, etc.


Functions:  Assorted
Assorted Functions

Declare Function GetWavPlusVersion% Lib "WavPlus.DLL" ()

* this function returns the version of WavPlus.
* the returned value is 100 times the actual version number.
* for instance, a returned value of 150 represents version 1.50.

Declare Sub RevString Lib "WavPlus.DLL" (ByVal lpString$)

* this function reverses a string
* it is most useful in conjunction with VB's INSTR command; this way you can find the
  position of a substring searching from the end instead of the beginning

* lpString$ is the string to reverse
* using RevString twice on the same string will restore it to the original character
  sequence


Functions:  Wav System Info (MCI)
Wav System Info Functions (MCI)

Declare Sub WavCanPlay Lib "WavPlus.DLL" (ByVal lpString$)

* this command determines if the system can play Wav files

* before using, set lpString$=Space$(255)
* returns "true" if the system can play Wav files; returns "false" otherwise

Declare Sub WavCanRecord Lib "WavPlus.DLL" (ByVal lpString$)

* this command determines if the system can record Wav files

* before using, set lpString$=Space$(255)
* returns "true" if the system can record Wav files; returns "false" otherwise

Declare Sub WavMaxBitSize Lib "WavPlus.DLL" (ByVal lpString$)

* this command determines the maximum bit size capability of the system

* before using, set lpString$=Space$(255)
* returns "8" or "16"

Declare Sub WavMaxChannels Lib "WavPlus.DLL" (ByVal lpString$)

* this command determines the maximum number of channels the system is capable of

* before using, set lpString$=Space$(255)
* returns "Mono" or "Stereo"

Declare Sub WavMaxSampleRate Lib "WavPlus.DLL" (ByVal lpString$)

* this command determines the maximum sample rate (Hz) capability for the system

* before using, set lpString$=Space$(255)

* returns "11025", "22050", or "44100"


Functions:  Wav File Info (MCI)
Wav File Info Functions (MCI)

Only use these commands on files that are NOT open.

Declare Sub WavGetLengthMS Lib "WavPlus.DLL" (ByVal lpFileName$, ByVal lpString$)

* this command obtains the length (in milliseconds) of a Wav file

* lpFileName$ is the full path of the Wav file
* before using, set lpString$=Space$(255)

* upon completion, lpString$ contains the length (in milliseconds)

Declare Sub WavGetLengthBytes Lib "WavPlus.DLL" (ByVal lpFileName$, ByVal lpString$)

* this command obtains the length (in bytes) of a Wav file

* lpFileName$ is the full path of the Wav file
* before using, set lpString$=Space$(255)

* upon completion, lpString$ contains the length (in bytes)

Declare Sub WavGetBitSize Lib "WavPlus.DLL" (ByVal lpFileName$, ByVal lpString$)

* this command obtains the bit size of a Wav file

* lpFileName$ is the full path of the Wav file
* before using, set lpString$=Space$(255)

* upon completion, lpString$ contains the bit size; typically "8" or "16"

Declare Sub WavGetChannels Lib "WavPlus.DLL" (ByVal lpFileName$, ByVal lpString$)

* this command obtains the number of channels for a Wav file

* lpFileName$ is the full path of the Wav file
* before using, set lpString$=Space$(255)

* upon completion, lpString$ contains the number of channels; typically "1" for Mono or
  "2" for Stereo

Declare Sub WavGetSampleRate Lib "WavPlus.DLL" (ByVal lpFileName$, ByVal lpString$)

* this command obtains the sample rate (in Hz) for a Wav file

* lpFileName$ is the full path of the Wav file
* before using, set lpString$=Space$(255)

* upon completion, lpString$ contains the sample rate; typically "11025", "22050", or "44100"


Functions:  Wav Open Session (MCI)
Wav Open Session Functions (MCI)

Before using the Open Session commands, a Wav file
MUST first be opened with WavOpen.

Before using these commands, be SURE to set lpString$=Space$(255).
This provides an information (or error) return buffer.

Declare Sub WavOpen Lib "WavPlus.DLL" (ByVal lpFileName$, ByVal lpString$)

* opens a Wav file for use by the other MCI open session commands

* lpFileName$ is the full path of the Wav file

* upon return, if lpString$ contains only CHR$(0), the file was opened successfully;
  otherwise lpString$ will contain an error message

Declare Sub WavClose Lib "WavPlus.DLL" (ByVal lpString$)

* closes an opened Wav file

* upon return, if lpString$ contains only CHR$(0), the file was opened successfully;
  otherwise lpString$ will contain an error message

Declare Sub WavPause Lib "WavPlus.DLL" (ByVal lpString$)

* pauses an open Wav file in play

* upon return, lpString$ will contain an error message (if applicable)

Declare Sub WavStop Lib "WavPlus.DLL" (ByVal lpString$)

* stops an open Wav file in play, and returns the position pointer to "0" milliseconds

* upon return, lpString$ will contain an error message (if applicable)

Declare Sub WavStart Lib "WavPlus.DLL" (ByVal lpString$)

* starts playing an open Wav file (does not wait for completion)

* upon return, lpString$ will contain an error message (if applicable)

Declare Sub WavStartSectionWait Lib "WavPlus.DLL" (ByVal lpSecStart$, ByVal lpSecEnd$, ByVal lpString$)

* plays the specified section of an open Wav file (waits for completion)

* lpSecStart$ is the starting position (in milliseconds)
* lpSecEnd$ is the ending position (in milliseconds)

* upon return, lpString$ will contain an error message (if applicable)

Declare Sub WavStartSectionNoWait Lib "WavPlus.DLL" (ByVal lpSecStart$, ByVal lpSecEnd$, ByVal lpString$)

* starts playing the specified section of an open Wav file (does not wait for completion)

* lpSecStart$ is the starting position (in milliseconds)
* lpSecEnd$ is the ending position (in milliseconds)

* upon return, lpString$ will contain an error message (if applicable)

Declare Sub WavSeekEnd Lib "WavPlus.DLL" (ByVal lpString$)

* moves the position pointer to the end of the file

* upon return, lpString$ will contain an error message (if applicable)

Declare Sub WavSeekStart Lib "WavPlus.DLL" (ByVal lpString$)

* moves the position pointer to the start of the file

* upon return, lpString$ will contain an error message (if applicable)

Declare Sub WavSeekPosition Lib "WavPlus.DLL" (ByVal lpStrValue$, ByVal lpString$)

* moves the position pointer to the specified location (in milliseconds) in the file

* lpStrValue$ is the new location (in milliseconds)

* upon return, lpString$ will contain an error message (if applicable)

Declare Sub WavStatusMode Lib "WavPlus.DLL" (ByVal lpString$)

* returns the status of the currently open Wav file

upon return, lpString$ contains the current status (one of the following):
not ready, paused, playing, stopped, recording, or seeking

* unless you record and playback Wav files in a self-contained form such as the VB demo
  program uses; you should test the current status in a Timer event.  MCI commands can
  not open a new file until the last one is closed.

Declare Sub WavStatusLengthMS Lib "WavPlus.DLL" (ByVal lpString$)

* returns the length (in milliseconds) of the open Wav file

Declare Sub WavStatusLengthBytes Lib "WavPlus.DLL" (ByVal lpString$)

* returns the length (in bytes) of the open Wav file
* note: this is not the file size; it is the size of the recorded Wav data

Declare Sub WavStatusPosition Lib "WavPlus.DLL" (ByVal lpString$)

* returns the current position of the file (in milliseconds)

Declare Sub WavStatusBitSize Lib "WavPlus.DLL" (ByVal lpString$)

* returns the bit size of the file; typically "8" or "16"

Declare Sub WavStatusChannels Lib "WavPlus.DLL" (ByVal lpString$)

* returns the channel size of the file; typically "1" for Mono or "2" for Stereo

Declare Sub WavStatusSampleRate Lib "WavPlus.DLL" (ByVal lpString$)

* returns the sample rate of the file (in Hz); typically "11025", "22050", or "44100"

Declare Sub WavRecord Lib "WavPlus.DLL" (ByVal lpString$)

* begins recording at the current file position
* note:  the recording is not permanent until saved

Declare Sub WavSave Lib "WavPlus.DLL" (ByVal lpFileName$, ByVal lpString$)

* stores the Wav file to disk

* lpFileName$ is the full path of the Wav file

Declare Sub WavEraseAll Lib "WavPlus.DLL" (ByVal lpString$)

* erases the entirety of the current Wav file
* note:  this is not permanent until saved

Declare Sub WavEraseSection Lib "WavPlus.DLL" (ByVal lpSecStart$, ByVal lpSecEnd$, ByVal lpString$)

* erases a section of the current Wav file
* note:  this is not permanent until saved

* lpSecStart$ is the starting position (in milliseconds)
* lpSecEnd$ is the ending position (in milliseconds)

Declare Sub WavSetBitSize Lib "WavPlus.DLL" (ByVal lpValue$, ByVal lpString$)

* sets the bit size for a new file

* lpValue$ will either be "8" or "16"; check lpString$ for an error message

Declare Sub WavSetChannels Lib "WavPlus.DLL" (ByVal lpValue$, ByVal lpString$)

* sets the number of channels for a new file

* lpValue$ will either be "1" (for Mono) or "2" (for Stereo); check lpString$ for an
  error message


Functions:  MIDI Info Functions (non-MCI)
Midi Info Functions (non-MCI)

Declare Function HowManyMidiPlayDevices% Lib "WavPlus.DLL" ()

* this function determines the number of system devices that can PLAY Mid files

* returns the number: 0 for none, 1 for one, etc.

Declare Function HowManyMidiRecordDevices% Lib "WavPlus.DLL" ()

* this function determines the number of system devices that can RECORD Mid files

* returns the number: 0 for none, 1 for one, etc.


Functions:  Midi Open Session (MCI)
Midi Open Session Functions (MCI)

Before using the Open Session commands, a Mid file
MUST first be opened with MidiOpen.

Before using these commands, be SURE to set lpString$=Space$(255).
This provides an information (or error) return buffer.

Declare Sub MidiOpen Lib "WavPlus.DLL" (ByVal lpFileName$, ByVal lpString$)

* opens a Mid file for use by the other MCI open session commands

* lpFileName$ is the full path of the Mid file

* upon return, if lpString$ contains only CHR$(0), the file was opened successfully;
  otherwise lpString$ will contain an error message

Declare Sub MidiClose Lib "WavPlus.DLL" (ByVal lpString$)

* closes an open Mid file

* upon return, if lpString$ contains only CHR$(0), the file was opened successfully;
  otherwise lpString$ will contain an error message

Declare Sub MidiPause Lib "WavPlus.DLL" (ByVal lpString$)

 * pauses a playing Mid file

Declare Sub MidiStop Lib "WavPlus.DLL" (ByVal lpString$)

* stops a playing Mid file and return to position pointer to "0"

Declare Sub MidiStart Lib "WavPlus.DLL" (ByVal lpString$)

* starts playing a Mid file (does not wait for completion)

Declare Sub MidiStartSectionWait Lib "WavPlus.DLL" (ByVal lpSecStart$, ByVal lpSecEnd$, ByVal lpString$)

* plays the specified section of an open Mid file (waits for completion)

* lpSecStart$ is the starting position (in milliseconds)
* lpSecEnd$ is the ending position (in milliseconds)

* upon return, lpString$ will contain an error message (if applicable)

Declare Sub MidiStartSectionNoWait Lib "WavPlus.DLL" (ByVal lpSecStart$, ByVal lpSecEnd$, ByVal lpString$)

* starts playing the specified section of an open Mid file (does not wait for completion)

* lpSecStart$ is the starting position (in milliseconds)
* lpSecEnd$ is the ending position (in milliseconds)

* upon return, lpString$ will contain an error message (if applicable)

Declare Sub MidiSeekEnd Lib "WavPlus.DLL" (ByVal lpString$)

* moves the position pointer to the end of the open Mid file

Declare Sub MidiSeekStart Lib "WavPlus.DLL" (ByVal lpString$)

* moves the position pointer to the start of the open Mid file

Declare Sub MidiSeekPosition Lib "WavPlus.DLL" (ByVal lpStrValue$, ByVal lpString$)

* moves the position pointer to the specified location (in milliseconds) in the file

* lpStrValue$ is the new location (in milliseconds)

* upon return, lpString$ will contain an error message (if applicable)

Declare Sub MidiStatusMode Lib "WavPlus.DLL" (ByVal lpString$)

* returns the status of the currently open Mid file

upon return, lpString$ contains the current status (one of the following):
not ready, paused, playing, stopped, recording, or seeking

* unless you record and playback Mid files in a self-contained form such as the VB demo
  program uses; you should test the current status in a Timer event.  MCI commands can
  not open a new file until the last one is closed.

Declare Sub MidiStatusLengthMS Lib "WavPlus.DLL" (ByVal lpString$)

* returns the length of the open Mid file (in milliseconds)

Declare Sub MidiStatusPosition Lib "WavPlus.DLL" (ByVal lpString$)

* returns the current position of the open Mid file (in milliseconds)

Declare Sub MidiRecord Lib "WavPlus.DLL" (ByVal lpString$)

* begins recording at the current file position of the Mid file

Declare Sub MidiSave Lib "WavPlus.DLL" (ByVal lpFileName$, ByVal lpString$)

* stores the current Mid file

* lpFileName$ is the full path of the Mid file

Declare Sub MidiEraseAll Lib "WavPlus.DLL" (ByVal lpString$)

* erases the entirety of the currently open Mid file

Declare Sub MidiEraseSection Lib "WavPlus.DLL" (ByVal lpSecStart$, ByVal lpSecEnd$, ByVal lpString$)

* erases a section of the current Mid file

* lpSecStart$ is the starting position (in milliseconds)
* lpSecEnd$ is the ending position (in milliseconds)